package com.gqz.equip.app.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 库存任务实体
 *
 * @author gqz20
 * @date 2023/02/25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_STOCK_TASK")
public class EnStockTaskEntity implements Serializable {

    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 任务编号
     */
    @TableField(value = "TASK_NO")
    private String taskNo;

    /**
     * 盘点对象编码
     */
    @TableField(value = "WAREHOUSE_NO")
    private String warehouseNo;

    /**
     * 盘点对象名称
     */
    @TableField(value = "WAREHOUSE_NAME")
    private String warehouseName;

    /**
     * 任务名称
     */
    @TableField(value = "TASK_NAME")
    private String taskName;

    /**
     * 盘点对象类型编码
     */
    @TableField(value = "STOCK_TYPE")
    private String stockType;

    /**
     * 盘点对象类型名称
     */
    @TableField(value = "STOCK_TYPE_NAME")
    private String stockTypeName;

    /**
     * 单位编码
     */
    @TableField(value = "DEPT_NO")
    private String deptNo;

    /**
     * 单位名称
     */
    @TableField(value = "DEPT_NAME")
    private String deptName;

    /**
     * 任务类型编码
     */
    @TableField(value = "TASK_TYPE_NO")
    private String taskTypeNo;

    /**
     * 计划开始时间
     */
    @TableField(value = "PLAN_STIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "planStime", format = "yyyy-MM-dd HH:mm:ss")
    private Date planStime;

    /**
     * 计划结束时间
     */
    @TableField(value = "PLAN_ETIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "planEtime", format = "yyyy-MM-dd HH:mm:ss")
    private Date planEtime;

    /**
     * 周期
     */
    @TableField(value = "PERIOD")
    private String period;

    /**
     * 周期截止时间
     */
    @TableField(value = "PERIOD_ETIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "periodEtime", format = "yyyy-MM-dd HH:mm:ss")
    private Date periodEtime;

    /**
     * 盘点人员编码
     */
    @TableField(value = "PERSON_NO")
    private String personNo;

    /**
     * 盘点人员名称
     */
    @TableField(value = "PERSON_NAME")
    private String personName;

    /**
     * 详细描述
     */
    @TableField(value = "DESCRIPTION")
    private String description;

    /**
     * 是否删除
     */
    @TableField(value = "IS_DEL")
    private String isDel;

    /**
     * 创建人
     */
    @TableField(value = "CREATOR")
    private String creator;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "createTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 任务状态
     */
    @TableField(value = "TASK_STATUS")
    private String taskStatus;

    /**
     * 派单人
     */
    @TableField(value = "SEND_PERSON")
    private String sendPerson;

    /**
     * 派单时间
     */
    @TableField(value = "SEND_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "sendTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    /**
     * 派单人电话
     */
    @TableField(value = "SEND_TEL")
    private String sendTel;

    /**
     * app结论
     */
    @TableField(value = "CONCLUSION")
    private String conclusion;

    /**
     * 任务类型名称
     */
    @TableField(value = "TASK_TYPE_NAME")
    private String taskTypeName;

    /**
     * 任务状态名称
     */
    @TableField(value = "TASK_STATUS_NAME")
    private String taskStatusName;

    /**
     * 是否周期产生的工单
     */
    @TableField(value = "IS_PERIOD")
    private String isPeriod;

    /**
     * 周期工单的源工单
     */
    @TableField(value = "SOURCE_TASK_NO")
    private String sourceTaskNo;

    /**
     * 工单运行状态
     */
    @TableField(value = "RUN_STATUS")
    private String runStatus;

    /**
     * 工单运行状态名称
     */
    @TableField(value = "RUN_STATUS_NAME")
    private String runStatusName;

    /**
     * 评价说明
     */
    @TableField(value = "APPRAISE_CONTENT")
    private String appraiseContent;

    /**
     * 评价人
     */
    @TableField(value = "APPRAISE_PERSON")
    private String appraisePerson;

    /**
     * 评价时间
     */
    @TableField(value = "APPRAISE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "appraiseTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date appraiseTime;

    /**
     * 评价结论 1合格 2不合格
     */
    @TableField(value = "APPRAISE_STATUS")
    private String appraiseStatus;

    /**
     * 评价结论 合格 不合格
     */
    @TableField(value = "APPRAISE_STATUS_NAME")
    private String appraiseStatusName;

    /**
     * 盘点时间
     */
    @TableField(value = "STOCK_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "stockTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date stockTime;

    /**
     * app端任务运行状态（1代办2在办3退单4已办）
     */
    @TableField(value = "APP_RUN_STATUS")
    private String appRunStatus;

    /**
     * 接单人id
     */
    @TableField(value = "RECEIVER_ID")
    private String receiverId;

    /**
     * 接单人
     */
    @TableField(value = "RECEIVER")
    private String receiver;

    /**
     * 接单时间
     */
    @TableField(value = "RECEIVING_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "receivingTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date receivingTime;

    /**
     * 接单坐标
     */
    @TableField(value = "RECEIVING_COORDINATE")
    private String receivingCoordinate;

    /**
     * app结束时间
     */
    @TableField(value = "APP_END_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "appEndTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date appEndTime;

    /**
     * 结束坐标
     */
    @TableField(value = "END_COORDINATE")
    private String endCoordinate;

    @TableField(value = "REMARK")
    private String remark;

    /**
     * 创建人id
     */
    @TableField(value = "CREATOR_BM")
    private String creatorBm;

    /**
     * start����Ǳ���Ҫ�Ķ�̬��������start   start
     */
    private static Map<String, SFunction<EnStockTaskEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("taskNo", EnStockTaskEntity::getTaskNo);
        map.put("warehouseNo", EnStockTaskEntity::getWarehouseNo);
        map.put("warehouseName", EnStockTaskEntity::getWarehouseName);
        map.put("taskName", EnStockTaskEntity::getTaskName);
        map.put("stockType", EnStockTaskEntity::getStockType);
        map.put("stockTypeName", EnStockTaskEntity::getStockTypeName);
        map.put("deptNo", EnStockTaskEntity::getDeptNo);
        map.put("deptName", EnStockTaskEntity::getDeptName);
        map.put("taskTypeNo", EnStockTaskEntity::getTaskTypeNo);
        map.put("planStime", EnStockTaskEntity::getPlanStime);
        map.put("planEtime", EnStockTaskEntity::getPlanEtime);
        map.put("period", EnStockTaskEntity::getPeriod);
        map.put("periodEtime", EnStockTaskEntity::getPeriodEtime);
        map.put("personNo", EnStockTaskEntity::getPersonNo);
        map.put("personName", EnStockTaskEntity::getPersonName);
        map.put("description", EnStockTaskEntity::getDescription);
        map.put("isDel", EnStockTaskEntity::getIsDel);
        map.put("creator", EnStockTaskEntity::getCreator);
        map.put("createTime", EnStockTaskEntity::getCreateTime);
        map.put("taskStatus", EnStockTaskEntity::getTaskStatus);
        map.put("sendPerson", EnStockTaskEntity::getSendPerson);
        map.put("sendTime", EnStockTaskEntity::getSendTime);
        map.put("sendTel", EnStockTaskEntity::getSendTel);
        map.put("conclusion", EnStockTaskEntity::getConclusion);
        map.put("taskTypeName", EnStockTaskEntity::getTaskTypeName);
        map.put("taskStatusName", EnStockTaskEntity::getTaskStatusName);
        map.put("id", EnStockTaskEntity::getId);
        map.put("isPeriod", EnStockTaskEntity::getIsPeriod);
        map.put("sourceTaskNo", EnStockTaskEntity::getSourceTaskNo);
        map.put("runStatus", EnStockTaskEntity::getRunStatus);
        map.put("runStatusName", EnStockTaskEntity::getRunStatusName);
        map.put("appraiseContent", EnStockTaskEntity::getAppraiseContent);
        map.put("appraisePerson", EnStockTaskEntity::getAppraisePerson);
        map.put("appraiseTime", EnStockTaskEntity::getAppraiseTime);
        map.put("appraiseStatus", EnStockTaskEntity::getAppraiseStatus);
        map.put("appraiseStatusName", EnStockTaskEntity::getAppraiseStatusName);
        map.put("stockTime", EnStockTaskEntity::getStockTime);
        map.put("appRunStatus", EnStockTaskEntity::getAppRunStatus);
        map.put("receiverId", EnStockTaskEntity::getReceiverId);
        map.put("receiver", EnStockTaskEntity::getReceiver);
        map.put("receivingTime", EnStockTaskEntity::getReceivingTime);
        map.put("receivingCoordinate", EnStockTaskEntity::getReceivingCoordinate);
        map.put("appEndTime", EnStockTaskEntity::getAppEndTime);
        map.put("endCoordinate", EnStockTaskEntity::getEndCoordinate);
        map.put("remark", EnStockTaskEntity::getRemark);
        map.put("creatorBm", EnStockTaskEntity::getCreatorBm);

    }

    public static SFunction<EnStockTaskEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end����Ǳ���Ҫ�Ķ�̬��������end   end */


}
